#!/bin/bash

##=======================================================================
#BSUB -a poe                     # use LSF openmp elim
#BSUB -N
#BSUB -n 1                      # yellowstone setting
#BSUB -o out.%J                  # output filename
#BSUB -e out.%J                  # error filename
#BSUB -q geyser                # queue
#BSUB -J tc_tracker
#BSUB -W 02:00                    # wall clock limit
#BSUB -P P35201098               # account number

################################################################

date

PATH=$PATH:/glade/u/home/zarzycki/tstorms/source/trajectory:/glade/u/home/zarzycki/tstorms/source/tstorms
export PATH

### Things in here that are sedded from sub_parallel.sh
DATA_YEAR=2002
DATA_MONTH=12
homedir=/glade/u/home/zarzycki
basedir=/glade/scratch/zarzycki/camsetracking
loopdir=2002/12

### Begin run
datadir=$basedir/$loopdir
mkdir -p $datadir

### OLD HACK FOR NCEP DATA TO REVERSE LAT FOR VORTICITY
###cd /glade/scratch/zarzycki/ncep_data/
###ncpdq -O -h -a -lat ncep_${DATA_YEAR}.nc ncep_${DATA_YEAR}.nc

cd $datadir

shopt -s nullglob
for f in /glade/scratch/zarzycki/h1files/ne30/${DATA_YEAR}/ne30amip.cam.h1.${DATA_YEAR}-${DATA_MONTH}*.nc
#for f in /glade/scratch/zarzycki/h1files/atl30x4/${DATA_YEAR}/atl_30_x4_refine_nochem.cam.h1.${DATA_YEAR}-${DATA_MONTH}*.nc
#for f in /glade/scratch/zarzycki/h1files/atl30x4/${DATA_YEAR}/atl_30_x4_refine_nochem.cam.h1.${DATA_YEAR}-${DATA_MONTH}*.nc
do
	echo "Processing - $f"
  $homedir/tstorms/scripts/run_tstorms_general $f $datadir
done

cd $datadir

#### Move filtered data into output
#mv ori_filt output/
#mv traj_filt output/

date


